﻿/// <reference path="DataService.js" />
/// <reference path="../Plugins/date.format.js" />
/// <reference path="../HtmlDesign/lib/js/jquery-1.10.2.min.js" />

function StreamingHelper() {

    this.InitModal = function(url, caption) {
        $('#myModal h4.modal-title').text(caption);
        $('#myModalBody').empty();
        var html = '<video id="myVideo" width="100%" height="100%" autoplay="autoplay" controls="controls">' +
                        '<source src="' + url + '" type="video/mp4">' +
                        'Your browser does not support the video tag.' +
                   '</video>';
        $('#myModalBody').append(html);
        $('#myModal').modal('show');

        $('#myModal').on('hidden.bs.modal', function (e) {
            var myvideo = document.getElementById("myVideo");
            if (myvideo != null) {
                myvideo.pause();   
            }
            $('#myModalBody').empty();
        })        
    }
}